package com.mcp.converter.domain.report;

import com.mcp.converter.domain.checker.CompatibilityResult;
import com.mcp.converter.domain.converter.ConversionResult;

/**
 * 报告生成器接口
 * 负责生成不兼容分析报告
 */
public interface ReportGenerator {
    
    /**
     * 生成不兼容分析报告
     * @param compatibilityResult 兼容性检测结果
     * @param conversionResult SQL转换结果
     * @return 不兼容分析报告
     */
    IncompatibilityReport generate(CompatibilityResult compatibilityResult, ConversionResult conversionResult);
    
    /**
     * 导出报告
     * @param report 不兼容分析报告
     * @param format 报告格式
     * @return 导出结果
     */
    ExportResult export(IncompatibilityReport report, ReportFormat format);
    
    /**
     * 报告格式枚举
     */
    enum ReportFormat {
        /**
         * JSON格式
         */
        JSON,
        
        /**
         * HTML格式
         */
        HTML,
        
        /**
         * PDF格式
         */
        PDF,
        
        /**
         * 文本格式
         */
        TEXT
    }
    
    /**
     * 导出结果类
     */
    class ExportResult {
        private boolean success;
        private String message;
        private String filePath;
        private byte[] content;
        
        public ExportResult(boolean success, String message) {
            this.success = success;
            this.message = message;
        }
        
        public ExportResult(boolean success, String message, String filePath) {
            this(success, message);
            this.filePath = filePath;
        }
        
        public ExportResult(boolean success, String message, byte[] content) {
            this(success, message);
            this.content = content;
        }
        
        public boolean isSuccess() {
            return success;
        }
        
        public String getMessage() {
            return message;
        }
        
        public String getFilePath() {
            return filePath;
        }
        
        public byte[] getContent() {
            return content;
        }
    }
}
